package cn.jxau.bean.po;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.KeySequence;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

/**
 * 邮件收发表
 * @author licho
 *
 */
@TableName("t_email")
@KeySequence("t_sequence_email")
public class Email implements Serializable {
	private static final long serialVersionUID = 1L;
	@TableId(type=IdType.INPUT)
	private Long id;//主键
	private String sendID;//发送者ID
	private String reciveID;//接受者ID
	private Date tdate;//发送日期
	private Boolean hasRead=Boolean.FALSE;//是否已读，默认为0，未读
	private String title;//主题
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getSendID() {
		return sendID;
	}
	public void setSendID(String sendID) {
		this.sendID = sendID;
	}
	public String getReciveID() {
		return reciveID;
	}
	public void setReciveID(String reciveID) {
		this.reciveID = reciveID;
	}
	public Date getTdate() {
		return tdate;
	}
	public void setTdate(Date tdate) {
		this.tdate = tdate;
	}
	public Boolean getHasRead() {
		return hasRead;
	}
	public void setHasRead(Boolean hasRead) {
		this.hasRead = hasRead;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Override
	public String toString() {
		return "Email [id=" + id + ", sendID=" + sendID + ", reciveID=" + reciveID + ", tdate=" + tdate + ", hasRead="
				+ hasRead + ", title=" + title + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((hasRead == null) ? 0 : hasRead.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((reciveID == null) ? 0 : reciveID.hashCode());
		result = prime * result + ((sendID == null) ? 0 : sendID.hashCode());
		result = prime * result + ((tdate == null) ? 0 : tdate.hashCode());
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Email other = (Email) obj;
		if (hasRead == null) {
			if (other.hasRead != null)
				return false;
		} else if (!hasRead.equals(other.hasRead))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (reciveID == null) {
			if (other.reciveID != null)
				return false;
		} else if (!reciveID.equals(other.reciveID))
			return false;
		if (sendID == null) {
			if (other.sendID != null)
				return false;
		} else if (!sendID.equals(other.sendID))
			return false;
		if (tdate == null) {
			if (other.tdate != null)
				return false;
		} else if (!tdate.equals(other.tdate))
			return false;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		return true;
	}
	
}
